/*
 * @Author: zxc
 * @Date: 2021-01-24 10:14:46
 * @LastEditTime: 2021-01-24 14:42:15
 * @LastEditors: zxc
 * @Description: lodash函数编程模块使用
 */
import _ from "lodash/fp"

// console.log(_.map(_.toUpper, ['a', 'b']))

const f = _.flowRight(_.join("-"), _.map(_.toLower), _.split(" "))
// console.log(f("NEVER SAY DIE"))

console.log(_.map(parseInt, ["12", "8", "10"]))

const fp_lower = _.flowRight(_.replace(/\s+/g, "_"), _.toLower)
// console.log(fp_lower("Hello world"))

const firstLetterToUpper = _.flowRight(
  _.join(". "),
  _.map(_.flowRight(_.first, _.toUpper)),
  _.split(" ")
)
console.log(firstLetterToUpper("world will web")) //W. W. W
